//
//  OpGuideController.m
//  LoveBeeProject
//
//  Created by skywalker on 17/1/8.
//  Copyright © 2017年 斯芬克斯. All rights reserved.
//

#import "OpGuideController.h"
#import "GuideView.h"
//图片个数
#import "OpHeaderPageController.h"
#define KGuideImageCount 4

@interface OpGuideController ()

@end

@implementation OpGuideController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //主界面的图片
    [self setupUI];
    
    
    //是否要显示新特性界面
    BOOL isShow = YES;
    //如果要显示就会创建它
    if (isShow == YES)
    {
        //显示新特性界面
        [self makeGuideView];
      
    }

}
#pragma mark - 新特性界面
- (void)makeGuideView
{
    //1.创建新特性界面
    GuideView* guideView = [[GuideView alloc] initWithFrame:self.view.bounds];
    //2.提供数据
    guideView.imageName = [self loadImageName];
    //3.添加父控件
    [self.view addSubview:guideView];
}

#pragma mark - 主界面
- (void)setupUI
{
    //创建用来显示主界面图片的imageView
    UIImageView* imageView = [[UIImageView alloc] init];
    imageView.backgroundColor = [UIColor redColor];
    
}

#pragma mark - 加载图片名称
- (NSArray*)loadImageName
{
    //当可变数组中添加的元素个数是一定的,最好用下面这个方法给它初始化容量
    NSMutableArray* Marr = [NSMutableArray arrayWithCapacity:KGuideImageCount];
    //for循环拼接图片名称
    for(NSInteger i = 0;i < KGuideImageCount;i++)
    {
        NSString* imageName = [NSString stringWithFormat:@"guide_40_%zd@2x.png",i + 1];
        //把图片名称添加到数组中
        [Marr addObject:imageName];
    }
    //把突变数组进行一个不可变拷贝
    return Marr.copy;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
